<div class="settings-page">
  <div class="container page">
    <div class="row">
      <div class="col-md-6 offset-md-3 col-xs-12">
        <h1 class="text-xs-center">Your Settings</h1>
        <cdt-list-errors />
        <form [formGroup]="form" (ngSubmit)="onSubmit()">
          <fieldset class="form-group">
            <input
              formControlName="image"
              type="text"
              id="image"
              placeholder="URL of profile picture"
              class="form-control form-control-lg"
            />
          </fieldset>
          <fieldset class="form-group required">
            <input
              formControlName="username"
              type="text"
              id="username"
              placeholder="Your Name"
              class="form-control form-control-lg"
            />
            <cdt-input-errors [control]="form.controls.username" />
          </fieldset>
          <fieldset class="form-group">
            <textarea
              class="form-control form-control-lg"
              rows="5"
              id="bio"
              formControlName="bio"
              placeholder="Short bio about you"
            >
            </textarea>
          </fieldset>
          <fieldset class="form-group required">
            <input
              formControlName="email"
              type="email"
              id="email"
              placeholder="Email"
              class="form-control form-control-lg"
            />
            <cdt-input-errors [control]="form.controls.email" />
          </fieldset>
          <fieldset class="form-group required">
            <input
              formControlName="password"
              type="password"
              id="password"
              placeholder="New Password"
              class="form-control form-control-lg"
            />
            <cdt-input-errors [control]="form.controls.password" />
          </fieldset>
          <button
            data-testid="edit-button-container"
            class="btn btn-lg btn-primary"
            [disabled]="form.invalid || form.pending"
            type="submit"
          >
            Update Settings
          </button>
        </form>
        <hr />
        <button class="btn btn-outline-danger" (click)="logout()">Or click here to logout.</button>
      </div>
    </div>
  </div>
</div>
